<template>
	<div class="home">
		<div class="message" @click="message">
			<img src="../assets/images/pic2.jpg">
		</div>
		<div class="item" @click="item(1)">
			<img src="../assets/images/pic3.jpg">
		</div>
	</div>
</template>

<script>
import GetQueryString from '@/assets/js/getQueryString.js'
export default {
  	name: 'Home',
  	components: {},
	mounted(){
		console.log('当前环境',process.env.VUE_APP_APPID,process.env.VUE_APP_BASE_URL)
	},
  	methods:{
		// async getList(){
		// 	let res = await this.$http.get(this.$api.Index.index)
		// 	console.log('测试接口----',res)
		// 	if (res) {
		// 		console.log('请求成功')
		// 	}
		// },
		//登录
		login(){
			if(localStorage.getItem('openId')) {
			console.log('已登录')
			}else{
				if (!GetQueryString('code')) {
				// let currentUrl = encodeURIComponent('process.env.VUE_APP_BASE_URL')
				// window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+process.env.VUE_APP_APPID+'&redirect_uri=' + currentUrl + '&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'
				// } else {
				// let code = GetQueryString('code')
				// let state = GetQueryString('state')
				// this.getWeixinOpenID(code, state)
				}
			}
		},
		//获取openid
		// async getWeixinOpenID(code,state){
		// 	let res = await this.$http.get(this.$api.Index.index)

		// },
		//点击获取邮票
		message(){
			console.log('点击获取邮票')
			this.$router.push({
				path: 'pay' 
			}).catch(error => {
				console.info(error.message)
			})
		},
		//点击
		item(e){
			console.log(e)
			console.log('点击其他')
			this.$notify({ type: 'warning', message: '该功能暂未开放' });
		}
  	}
}

</script>
<style lang="scss" scoped>
	.home{
		.message{
			font-size: 0;
		}
		.item{
			font-size: 0;
		}
		img{
			width: 100%;
		}
	}
</style>